package com.sj.purchase.modules.cost.domain.imei;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by yangrd on 2017/10/16
 **/
@Entity
@Table(name = "t_inventory")
public class Inventory implements Serializable {

    @EmbeddedId
    private InventoryId id;

    private String skuName;

    private String referNo;//参考单

    private Double costPrice;//成本价

    private String inOrderNo;//入库单

    private String outShipNo;//出库单

    private String outOrderNo;//订单号

    @Temporal(TemporalType.TIMESTAMP)
    private Date outStockDate;//出库日期

    private String skuNo;

    private String spuNo;

    private String shopName;

    public Inventory() {
    }

    public Inventory(InventoryId id, String skuName, String referNo, Double costPrice, String inOrderNo, String spuNo, String skuNo,String outShipNo,String outOrderNo) {
        this.id = id;
        this.skuName = skuName;
        this.referNo = referNo;
        this.costPrice = costPrice;
        this.inOrderNo = inOrderNo;
        this.spuNo = spuNo;
        this.skuNo = skuNo;
        this.outOrderNo = outOrderNo;
        this.outShipNo = outShipNo;
    }
    public Inventory(InventoryId id, String skuName, String referNo, Double costPrice, String inOrderNo, String spuNo, String skuNo) {
        this.id = id;
        this.skuName = skuName;
        this.referNo = referNo;
        this.costPrice = costPrice;
        this.inOrderNo = inOrderNo;
        this.spuNo = spuNo;
        this.skuNo = skuNo;
    }

    public InventoryId getId() {
        return id;
    }

    public Inventory setId(InventoryId id) {
        this.id = id;
        return this;
    }

    public String getSkuName() {
        return skuName;
    }

    public Inventory setSkuName(String skuName) {
        this.skuName = skuName;
        return this;
    }

    public String getReferNo() {
        return referNo;
    }

    public Inventory setReferNo(String referNo) {
        this.referNo = referNo;
        return this;
    }

    public Double getCostPrice() {
        return costPrice;
    }

    public Inventory setCostPrice(Double costPrice) {
        this.costPrice = costPrice;
        return this;
    }

    public String getInOrderNo() {
        return inOrderNo;
    }

    public Inventory setInOrderNo(String inOrderNo) {
        this.inOrderNo = inOrderNo;
        return this;
    }

    public String getOutShipNo() {
        return outShipNo;
    }

    public Inventory setOutShipNo(String outShipNo) {
        this.outShipNo = outShipNo;
        return this;
    }

    public String getOutOrderNo() {
        return outOrderNo;
    }

    public Inventory setOutOrderNo(String outOrderNo) {
        this.outOrderNo = outOrderNo;
        return this;
    }

    public Date getOutStockDate() {
        return outStockDate;
    }

    public Inventory setOutStockDate(Date outStockDate) {
        this.outStockDate = outStockDate;
        return this;
    }

    public String getSkuNo() {
        return skuNo;
    }

    public Inventory setSkuNo(String skuNo) {
        this.skuNo = skuNo;
        return this;
    }

    public String getSpuNo() {
        return spuNo;
    }

    public Inventory setSpuNo(String spuNo) {
        this.spuNo = spuNo;
        return this;
    }

    public String getShopName() {
        return shopName;
    }

    public Inventory setShopName(String shopName) {
        this.shopName = shopName;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Inventory inventory = (Inventory) o;

        return id != null ? id.equals(inventory.id) : inventory.id == null;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "Inventory{" +
                "id=" + id +
                ", skuName='" + skuName + '\'' +
                ", referNo='" + referNo + '\'' +
                ", costPrice=" + costPrice +
                ", inOrderNo='" + inOrderNo + '\'' +
                ", outShipNo='" + outShipNo + '\'' +
                ", outOrderNo='" + outOrderNo + '\'' +
                ", outStockDate=" + outStockDate +
                ", skuNo='" + skuNo + '\'' +
                ", spuNo='" + spuNo + '\'' +
                ", shopName='" + shopName + '\'' +
                '}';
    }
}
